package math_sdk

/**
 * @author ljfirst
 * @version V1.0
 * @date 2023/9/12 23:50
 * @author-Email ljfirst@mail.ustc.edu.cn
 * @blogURL https://blog.csdn.net/ljfirst
 * @description
 **/
type Math struct {
}

// 求和
func (m *Math) Sum(value ...int) int {
	if len(value) == 0 {
		return 0
	}
	sum := 0
	for _, v := range value {
		sum += v
	}
	return sum
}

// k的n次方
func (m *Math) Power(k, n int) int {
	sum := 1
	for i := 1; i <= n; i++ {
		sum *= k
	}
	return sum
}
